<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>js操作dom</title>
		<script>
			function f1(){
				var a = document.createElement("a");
				a.innerHTML = "达内";
				a.href = "http://www.tmooc.cn";
				a.target = "_blank";
				var eles = document.getElementsByTagName("body");
				var body = eles[0];
				body.appendChild(a);
			}
		</script>
	</head>
	<body>
		<input type="button" value="创建超链接" onclick="f1()"/>
	</body>
</html>
